import json

class LoginDo():
    def __init__(self,uname,upass):
        self.uname = uname
        self.upass = upass

    def isLogin(self):
        is_login = 0
        filename = 'db\/user.json'
        with open(filename) as f_obj:
            users = json.load(f_obj)

        for user in users:
            #print(user['name'])
            if user['name'] == str(self.uname) and user['pass'] == str(self.upass):
                is_login = 1

        return  is_login